package com.coder.algorithm.leetcode;

import com.coder.algorithm.struct.ListNode;

import java.util.Arrays;

/**
 * Java 测试
 *
 * @author yuhushuan
 * @date 2020/10/20 00:14
 */
class j_test {
    public static void main(String[] args) {
        l_0024();

    }

    public static void l_0024() {
        l_0024 l_0024 = new l_0024();
        ListNode head = ListNode.Companion.create(new int[]{1, 2, 3, 4});
        System.out.println("输入：" + head.toString());
        head = l_0024.swapPairs(head);
        System.out.println("输出：" + head.toString());
    }

    public static void l_0034() {
        l_0034 l = new l_0034();
        int[] nums = new int[]{5, 7, 7, 8, 8, 10};
        arraysEquals(new int[]{3, 4}, l.searchRange(nums, 8));
        arraysEquals(new int[]{-1, -1}, l.searchRange(nums, 6));
    }

    public static void arraysEquals(int src[], int[] result) {
        if (Arrays.equals(src, result)) {
            System.out.println("通过：" + Arrays.toString(src));
        } else {
            System.out.println("失败");
            System.out.println("预期：" + Arrays.toString(src));
            System.out.println("结果：" + Arrays.toString(result));
        }
    }
}
